#!/bin/bash
if [ $# -ne 3 ];then
    echo "$0 licensefile outzipfile privatekey.txt"
    echo "example: $0 authorized.lic authorized.zip privatekey.txt"
    exit -1
fi

if [ ! -f dec.jar ];then
mkdir dec
javac -cp $PWD/libs/commons-io-2.6.jar:$PWD/libs/commons-codec-1.11.jar -d dec RsaDec.java
jar cvfm dec.jar MANIFEST.FM -C dec .
rm dec -rf
fi
java -cp libs/commons-io-2.6.jar:libs/commons-codec-1.11.jar:dec.jar RsaDec $1 $2 $3

echo "run command for token:"
echo "unzip -O cp936 $2"
